export default {
    panels: [
        {
        index: 0,
        name: 1,
        height: 297,
        width: 210,
        paperHeader: 39,
        paperFooter: 804,
        printElements: [
        {
        options: {
        left: 235.5,
        top: 9,
        height: 22.5,
        width: 151.5,
        title: "待发货区储存货物",
        coordinateSync: false,
        widthHeightSync: false,
        fontSize: 15,
        fontWeight: "bold",
        textContentVerticalAlign: "middle",
        qrCodeLevel: 0,
        right: 386.25,
        bottom: 29.25,
        vCenter: 310.5,
        hCenter: 18.75
        },
        printElementType: {
        title: "这是更新后的元素",
        type: "text"
        }
        },
        {
        options: {
        left: 18,
        top: 45,
        height: 54,
        width: 550,
        field: "table",
        coordinateSync: false,
        widthHeightSync: false,
        fontSize: 16.5,
        textAlign: "center",
        tableHeaderRowHeight: 25.5,
        tableHeaderFontSize: 15,
        tableHeaderFontWeight: "bold",
        tableBodyRowHeight: 24,
        right: 568,
        bottom: 84.75,
        vCenter: 293,
        hCenter: 64.5,
        rowsColumnsMerge: `function(data, col, collndex, rowlndex, tableData, printData) {
            // 只处理第一列 (Item 列)
            if (collndex == 0) {
                // 获取当前行的 ContractNo 值
                const currentItem = tableData[rowlndex]['ContractNo'];
                // 获取上一行的 ContractNo 值
                const previousItem = rowlndex > 0 ? tableData[rowlndex-1]['ContractNo'] : null;
        
                // 如果当前行和上一行的 Item 值相同，则合并
                if (currentItem === previousItem) {
                    return [0, 1]; // 被合并的行设置为 0
                } else {
                    // 计算有多少行需要合并
                    let rowspan = 1;
                    for (let i = rowlndex + 1; i < tableData.length; i++) {
                        if (tableData[i]['ContractNo'] === currentItem) {
                            rowspan++;
                        } else {
                            break;
                        }
                    }
                    return [rowspan, 1]; // 返回合并的行数
                }
            } else if (collndex == 2) {
                const currentItem = tableData[rowlndex]['LocationID'];
                const previousItem = rowlndex > 0 ? tableData[rowlndex - 1]['LocationID'] : null;
                if (currentItem === previousItem) {
                    return [0, 1];
                } else {
                    let rowspan = 1;
                    for (let i = rowlndex + 1; i < tableData.length; i++) {
                        if (tableData[i]['LocationID'] === currentItem) {
                            rowspan++;
                        } else {
                            break;
                        }
                    }
                    return [rowspan, 1];
                }
            }
            return [1, 1]; // 其他列不合并
        }
                `,
        columns: [
        [
        {
        width: 180.9460576923077,
        title: "合同号",
        field: "ContractNo",
        checked: true,
        columnId: "ContractNo",
        fixed: false,
        rowspan: 1,
        colspan: 1,
        tableQRCodeLevel: 0,
        tableSummaryTitle: true,
        tableSummary: ""
        },
        {
        width: 156.33255769230772,
        title: "箱号",
        field: "CaseNo",
        checked: true,
        columnId: "CaseNo",
        fixed: false,
        rowspan: 1,
        colspan: 1,
        tableQRCodeLevel: 0,
        tableSummaryTitle: true,
        tableSummary: ""
        },
        {
        width: 212.72138461538455,
        title: "货位",
        field: "LocationID",
        checked: true,
        columnId: "LocationID",
        fixed: false,
        rowspan: 1,
        colspan: 1,
        tableQRCodeLevel: 0,
        tableSummaryTitle: true,
        tableSummary: ""
        },
        {
        width: 100,
        title: "",
        field: "",
        checked: false,
        columnId: "",
        fixed: false,
        rowspan: 1,
        colspan: 1
        },
        {
        width: 100,
        title: "",
        field: "",
        checked: false,
        columnId: "",
        fixed: false,
        rowspan: 1,
        colspan: 1
        }
        ]
        ]
        },
        printElementType: {
        title: "空白表格",
        type: "table",
        editable: true,
        columnDisplayEditable: true,
        columnDisplayIndexEditable: true,
        columnTitleEditable: true,
        columnResizable: true,
        columnAlignEditable: true,
        isEnableEditField: true,
        isEnableContextMenu: true,
        isEnableInsertRow: true,
        isEnableDeleteRow: true,
        isEnableInsertColumn: true,
        isEnableDeleteColumn: true,
        isEnableMergeCell: true
        }
        }
        ],
        paperNumberLeft: 562.5,
        paperNumberTop: 814.5,
        paperNumberContinue: true,
        panelLayoutOptions: {
        layoutType: "column",
        layoutRowGap: 0,
        layoutColumnGap: 0
        }
        }
        ]
    }